/**
 *All rights reserved. This material is confidential and proprietary to Tungsten.
 */
package tungsten.t.database.testcase.inf.impl;

import java.sql.Types;

import tungsten.t.database.DBParamWrapper;
import tungsten.t.database.dao.DaoManager;
import tungsten.t.database.entity.type.TableName;
import tungsten.t.database.testcase.inf.AbstractTestCase;
import tungsten.t.database.testcase.inf.TestCase;
import tungsten.t.database.testcase.inf.TestMethodAnnotation;

/**
 * 
 * @author tracy
 * @date 2013-9-3
 * @version Uno
 */
public class TestUser extends AbstractTestCase
{

    /**
     * @see TestCase#getDesc()
     */
    @Override
    public String getDesc()
    {
        return "用户属性";
    }

    @TestMethodAnnotation(desc = "查询指定用户ID的玩家昵称", paramsDesc = "param1 : UserId")
    public boolean testQueryUserName(String... args)
    {
        int userId = Integer.valueOf(args[0]);

        DBParamWrapper param = new DBParamWrapper();
        param.put(Types.INTEGER, userId);

        System.err.println(DaoManager.getDao().getOneValue(TableName.USERS,
                                                           "UserName",
                                                           "UserId = ?", param));
        return true;
    }
}
